Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some more Panthor fixes #210

Merged
merged 4 commits into from
Jul 19, 2024
Merged

Conversation

ginkage
Copy link
Collaborator

@ginkage ginkage commented Jul 18, 2024

The first two commits are actually present in the kernel 6.10 release, so no reason not to include them.
The third one is present in drm-tip, as well as in for-linux-next, and is authored by an ARM engineer, so I'd expect it to land soon.
The final one is found in the Collabora branch, and is the only one I have some doubts about. But, as I didn't squash it all this time, it would be easy to revert if needed.

bbrezillon and others added 4 commits July 18, 2024 17:05
The user is likely to leave all the drm_panthor_obj_array fields
to zero when the array is empty, which will cause an EINVAL failure.

v2:
- Added R-bs

Fixes: 4bdca11 ("drm/panthor: Add the driver frontend block")
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Liviu Dudau <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
A sync-only job is meant to provide a synchronization point on a
queue, so we can't return a NULL fence there, we have to add a signal
operation to the command stream which executes after all other
previously submitted jobs are done.

v2:
- Fixed a UAF bug
- Added R-bs

Fixes: de85488 ("drm/panthor: Add the scheduler logical block")
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Liviu Dudau <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
If a queue is already assigned to the hardware, then a newly submitted
job can start straight away without waiting for the tick. However in
this case the devfreq infrastructure isn't notified that the GPU is
busy. By the time the tick happens the job might well have finished and
no time will be accounted for the GPU being busy.

Fix this by recording the GPU as busy directly in queue_run_job() in the
case where there is a CSG assigned and therefore we just ring the
doorbell.

Fixes: de85488 ("drm/panthor: Add the scheduler logical block")
Signed-off-by: Steven Price <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Liviu Dudau <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
In the off-chance that waiting for the firmware to signal its booted status
timed out in the fast reset path, one must flush the cache lines for the
entire FW VM address space before reloading the regions, otherwise stale
values eventually lead to a scheduler job timeout.

Signed-off-by: Adrián Larumbe <[email protected]>
@amazingfate amazingfate merged commit 0a36ef3 into armbian:rk-6.1-rkr3 Jul 19, 2024
1 check passed
@rpardini
Copy link
Member

Hi, I'm not sure this is related, but very recently I've lost panthor.
I'm running on Meko r58x, this kernel sha1 7d54 (thus containing this), and I only get lvmpipe.

mekotronics-r58x-pro:~:# dmesg | grep -i -e drm -e panthor
[    5.173712] OF: fdt: Reserved memory: failed to reserve memory for node 'drm-logo@0': base 0x0000000000000000, size 0 MiB
[    5.173731] OF: fdt: Reserved memory: failed to reserve memory for node 'drm-cubic-lut@0': base 0x0000000000000000, size 0 MiB
[    6.646076] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp0 assign plane mask: Cluster0 | Esmart0[0x5], primary plane phy id: Esmart0[2]
[    6.646106] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp1 assign plane mask: Cluster1 | Esmart1[0xa], primary plane phy id: Esmart1[3]
[    6.646126] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp2 assign plane mask: Cluster2 | Esmart2[0x140], primary plane phy id: Esmart2[8]
[    6.646145] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp3 assign plane mask: Cluster3 | Esmart3[0x280], primary plane phy id: Esmart3[9]
[    6.646311] [drm] failed to init overlay plane Cluster0-win1
[    6.646351] [drm] failed to init overlay plane Cluster1-win1
[    6.646386] [drm] failed to init overlay plane Cluster2-win1
[    6.646421] [drm] failed to init overlay plane Cluster3-win1
[    6.656833] rockchip-drm display-subsystem: bound fdd90000.vop (ops 0xffff8000092ada00)
[    6.657888] rockchip-drm display-subsystem: bound fde80000.hdmi (ops 0xffff8000092c5f20)
[    6.658064] rockchip-drm display-subsystem: bound fde60000.dp (ops 0xffff8000092c93d0)
[    6.658352] rockchip-drm display-subsystem: failed to parse loader memory
[    6.658943] [drm] Initialized rockchip 4.0.0 20140818 for display-subsystem on minor 0
[    6.699902] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] Update mode to 2560x1440p60, type: 11(if:HDMI0, flag:0x0) for vp0 dclk: 248880000
[    6.700077] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] dclk_out0 div: 0 dclk_core0 div: 2
[    6.700093] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] set dclk_vop0 to 248880000, get 237600000
[    6.768326] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] Crtc atomic disable vp0
[    6.787455] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] *ERROR* unexpected power on pd6
[    6.787465] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] *ERROR* unexpected power on pd5
[    6.909043] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] Update mode to 1920x1080p60, type: 11(if:HDMI0, flag:0x0) for vp0 dclk: 148500000
[    6.909203] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] dclk_out0 div: 0 dclk_core0 div: 2
[    6.909220] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] set dclk_vop0 to 148500000, get 148500000
[    6.987846] rockchip-drm display-subsystem: [drm] fb0: rockchipdrmfb frame buffer device
[    8.369613] [drm] Initialized rknpu 0.9.7 20240424 for fdab0000.npu on minor 1
[    8.651050] panthor fb000000.gpu-panthor: [drm] clock rate = 198000000
[    8.652581] panthor fb000000.gpu-panthor: Looking up mali-supply from device tree
[    8.653080] panthor fb000000.gpu-panthor: Looking up sram-supply from device tree
[    8.653085] panthor fb000000.gpu-panthor: Looking up sram-supply property in node /gpu-panthor@fb000000 failed
[    8.655308] panthor fb000000.gpu-panthor: EM: OPP:400000 is inefficient
[    8.655315] panthor fb000000.gpu-panthor: EM: OPP:300000 is inefficient
[    8.655413] panthor fb000000.gpu-panthor: EM: created perf domain
[    8.657040] panthor fb000000.gpu-panthor: [drm] mali-g610 id 0xa867 major 0x0 minor 0x0 status 0x5
[    8.658326] panthor fb000000.gpu-panthor: [drm] Features: L2:0x7120306 Tiler:0x809 Mem:0x301 MMU:0x2830 AS:0xff
[    8.659568] panthor fb000000.gpu-panthor: [drm] shader_present=0x50005 l2_present=0x1 tiler_present=0x1
[    8.662733] panthor fb000000.gpu-panthor: [drm] Firmware protected mode entry not be supported, ignoring
[    8.664277] panthor fb000000.gpu-panthor: [drm] CSF FW v1.1.0, Features 0x0 Instrumentation features 0x71
[    8.665722] [drm] Initialized panthor 1.0.0 20230801 for fb000000.gpu-panthor on minor 2
[    9.594049] systemd[1]: Starting Load Kernel Module drm...
[    9.613979] systemd[1]: [email protected]: Deactivated successfully.
[    9.614318] systemd[1]: Finished Load Kernel Module drm.
[   23.009449] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] Crtc atomic disable vp0
[   23.042634] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] *ERROR* unexpected power on pd6
[   23.042648] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] *ERROR* unexpected power on pd5
[   23.051057] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] Update mode to 3840x2160p30, type: 11(if:HDMI0, flag:0x0) for vp0 dclk: 297000000
[   23.051206] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] dclk_out0 div: 0 dclk_core0 div: 2
[   23.051218] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] set dclk_vop0 to 297000000, get 297000000

This was built with EXT=mesa-vpu RELEASE=jammy -- wonder if that firmware warn is relevant?

Not saying this is to blame, but has anyone an idea?

@amazingfate
Copy link
Collaborator

We can see panthor driver is loaded from dmesg.
After updating mesa in oibaf ppa, my gpu also become llvmpipe.
Since mesa 24.1 is released with panthor support, we may toggle to this ppa: https://launchpad.net/~kisak/+archive/ubuntu/kisak-mesa instead of bleeding edge oibaf git version.

@rpardini
Copy link
Member

toggle to this ppa: launchpad.net/~kisak/+archive/ubuntu/kisak-mesa instead of bleeding edge oibaf git version.

Confirmed, this works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants